package com.fengye.middleware.rabbitmq.boot.controller;

import com.fengye.middleware.rabbitmq.boot.dead.letter.DeadLetterInfo;
import com.fengye.middleware.rabbitmq.boot.dead.letter.DeadPublisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

/**
 *
 * @author sky
 * @date 2021年06月10日 11:40 上午
 */

@RestController
public class DeadLetterController {

    @Autowired
    private DeadPublisher publisher;

    @GetMapping("/send/letter")
    public void sendMsg() {

        Random random = new Random();
        DeadLetterInfo info = new DeadLetterInfo(random.nextInt(20), "控制器消息");
        publisher.sendMsg(info);

    }
}
